Skip to content

fix: improve Vector Stores OpenAI API conformance#5398

Merged
leseb merged 16 commits intollamastack:mainfrom
leseb:fix-vector-stores-conformance
Apr 8, 2026
Merged

fix: improve Vector Stores OpenAI API conformance#5398
leseb merged 16 commits intollamastack:mainfrom
leseb:fix-vector-stores-conformance

Conversation

@leseb
Copy link
Copy Markdown
Collaborator

@leseb leseb commented Apr 1, 2026

Summary

Fix schema issues in the Vector Stores API to improve OpenAI conformance from 61.3% to ~87%.

Supersedes #5394 (which was too broad, mixing embeddings + vector stores + OpenAPI generator changes).

Key changes

  • Add VectorStoreExpirationAfter model with anchor/days fields
  • Add VectorStoreStatus literal type and VectorStoreFileBatchFileEntry model
  • Make required fields non-optional to match OpenAI spec (name, usage_bytes, status, has_more)
  • Fix object fields to use Literal types with correct values
  • Add missing error codes (unsupported_file, invalid_file)
  • Make metadata nullable to match OpenAI spec
  • Add description field to vector store create request

Files changed (6 source + regenerated specs)

  • src/llama_stack_api/vector_io/models.py - schema fixes
  • src/llama_stack/core/routers/vector_io.py - pass newly required fields
  • src/llama_stack/providers/utils/memory/openai_vector_store_mixin.py - pass newly required fields
  • 3 test files updated for new required fields

Test plan

  • Unit tests pass (27 tests)
  • Mypy passes
  • Pre-commit passes
  • API spec codegen clean

🤖 Generated with Claude Code

leseb and others added 2 commits April 1, 2026 11:27
Fix schema issues in the Vector Stores API to improve OpenAI conformance
from 61.3% to 87.1%.

Key changes:
- Add VectorStoreExpirationAfter model with anchor/days fields
- Add VectorStoreStatus and VectorStoreFileBatchFileEntry types
- Make required fields non-optional (name, usage_bytes, status, etc.)
- Fix object literal types to match OpenAI spec
- Add missing error codes (unsupported_file, invalid_file)
- Make metadata nullable to match OpenAI spec

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

✱ Stainless preview builds

This PR will update the llama-stack-client SDKs with the following commit message.

fix: improve Vector Stores OpenAI API conformance
⚠️ llama-stack-client-go studio · conflict

Your SDK build had at least one error diagnostic.

⚠️ llama-stack-client-openapi studio · code

Your SDK build had at least one "warning" diagnostic.
generate ⚠️

⚠️ llama-stack-client-python studio · conflict

Your SDK build had at least one warning diagnostic.

⚠️ llama-stack-client-node studio · conflict

Your SDK build had at least one warning diagnostic.


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-04-08 16:26:18 UTC

@franciscojavierarceo
Copy link
Copy Markdown
Collaborator

Nice

leseb and others added 14 commits April 1, 2026 16:15
Fix vector_store.files_batch typo to vector_store.file_batch (matching
OpenAI spec). Add missing usage_bytes field to test constructors after
making it required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
… fix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
The usage_bytes field was made required but many code paths construct
VectorStoreFileObject and VectorStoreObject without setting it, causing
500 errors during file search operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Making usage_bytes optional is intentional - the runtime doesn't always
have this value available (e.g. during file search operations).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
The name field was changed from optional to required, but stored
vector stores may have name=null. Default to empty string to prevent
validation errors when loading existing data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
…ge in test

The VectorStoreSearchResponsePage model now requires the has_more
field, but the test_file_search_uses_default_search_mode_from_config
test was not updated to include it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
The vector store model changes altered how data is serialized in the LLM
request body during file_search operations, causing recording hash
mismatches in replay mode. Re-recorded the affected filter test
recordings to match the updated serialization format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
@leseb leseb marked this pull request as ready for review April 8, 2026 16:11
@leseb leseb added this pull request to the merge queue Apr 8, 2026
Merged via the queue into llamastack:main with commit 5ba8fcd Apr 8, 2026
73 checks passed
@leseb leseb deleted the fix-vector-stores-conformance branch April 8, 2026 16:25
franciscojavierarceo added a commit to franciscojavierarceo/llama-stack that referenced this pull request Apr 8, 2026
Includes fix: improve Vector Stores OpenAI API conformance (llamastack#5398)

BREAKING CHANGE: Vector Stores API schema updated for OpenAI conformance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants